package com.zhang.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import com.zhang.service.UserService;

public class UserController implements Controller {  
	  
    private UserService userService;  
      
    @Override  
    public ModelAndView handleRequest(HttpServletRequest req,  
            HttpServletResponse resp) throws Exception {  
    	System.out.println("loginName:"+req.getParameter("loginName"));
    	System.out.println("password"+req.getParameter("password"));
        System.out.println("HelloContr+oller.handleRequest()");  
        req.setAttribute("a", "aaaa");  
        userService.add(req.getParameter("loginName"));   
        return new ModelAndView("main");  
    }  
  
    public UserService getUserService() {  
        return userService;  
    }  
  
    public void setUserService(UserService userService) {  
        this.userService = userService;  
    }  
  
      
}  